// pages/rank/rank.js  
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tabArr: {
      curHdIndex: 0,
      curBdIndex: 0,
      resivelist_hb: [],
      resivelist_card: [],
      sendlist_hb: [],
      sendlist_card:[],
      resivelist_hb_me: [],
      resivelist_card_me: [],
      sendlist_hb_me: [],
      sendlist_card_me: [],
    },
    packet:true,
    card: true,
  },
  tomycard1:function(e){
    wx.navigateTo({
      url: '/pages/cardList/cardList?flag=a',
    })
  },
  tomycard2: function (e) {
    wx.navigateTo({
      url: '/pages/cardList/cardList?flag=b',
    })
  },
  tabFun: function (e) {
    //获取触发事件组件的dataset属性
    var _datasetId = e.target.dataset.id;
    var _obj = {};
    _obj.curHdIndex = _datasetId;
    _obj.curBdIndex = _datasetId;
    this.setData({
      tabArr: _obj
    });
  },
  packetHandle: function () {
    this.setData({
      packet: !this.data.packet
    })
  },
  cardHandle: function () {
    this.setData({
      card: !this.data.card
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var that = this
    wx.request({
      url: app.siteinfo.rootpath+'cardsort',
      data:{uid:app.siteinfo.userinfo.id},
      success:function(res){
        that.setData({
          sendlist_hb: res.data.sendlist_hb,
          sendlist_card: res.data.sendlist_card,
          resivelist_hb: res.data.resivelist_hb,
          resivelist_card: res.data.resivelist_card,
          sendlist_hb_me: res.data.sendlist_hb_me,
          sendlist_card_me: res.data.sendlist_card_me,
          resivelist_hb_me: res.data.resivelist_hb_me,
          resivelist_card_me: res.data.resivelist_card_me,
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
})